home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Taifun / Taifun 175 (1991-09-10)(Manewaldt, A.)(DE)(PD).zip / Taifun 175 (1991-09-10)(Manewaldt, A.)(DE)(PD).adf / Term / Libs.LZH / XprXModem / callback.asm next >
Assembly Source File  |  1991-07-26  |  2KB  |  54 lines

  1. *
  2. *   The following functions setup the proper registers for the call-back 
  3. *   functions.
  4. *
  5.         xdef _callad
  6. _callad:
  7.         movea.l 8(sp),a0                ; Second argument goes in a0
  8.         move.l  12(sp),d0               ; Third  argument goes in d0
  9.  
  10. *   Now this is a trick to avoid using another register.
  11. *   Charlie taught me this...
  12.  
  13.         move.l  4(sp),-(sp)             ; First  argument is function
  14.         rts
  15.  
  16.         xdef  _calladda
  17. _calladda:
  18.         movea.l 8(sp),a0                ; Second argument goes in a0
  19.         move.l  12(sp),d0               ; Third  argument goes in d0
  20.         move.l  16(sp),d1               ; Fourth argument goes in d1
  21.         movea.l 20(sp),a1               ; Fifth  argument goes in a1
  22.         move.l  4(sp),-(sp)             ; First  argument is function
  23.         rts
  24.  
  25.         xdef  _calla
  26. _calla:
  27.         movea.l 8(sp),a0                ; Second argument goes in a0
  28.         move.l  4(sp),-(sp)             ; First  argument is function
  29.         rts
  30.  
  31.         xdef  _calld
  32. _calld:
  33.         move.l 8(sp),d0                ; Second argument goes in d0
  34.         move.l  4(sp),-(sp)             ; First  argument is function
  35.         rts
  36.  
  37.         xdef  _callaa
  38. _callaa:
  39.         movea.l 8(sp),a0                ; Second argument goes in a0
  40.         movea.l 12(sp),a1               ; Third  argument goes in a1
  41.         move.l  4(sp),-(sp)             ; First  argument is function
  42.         rts
  43.  
  44.         xdef  _calladd
  45. _calladd:
  46.         move.l  8(sp),a0                ; Second argument goes in a0
  47.         move.l  12(sp),d0               ; Third  argument goes in d0
  48.         move.l  16(sp),d1               ; Fourth argument goes in d1
  49.         move.l  4(sp),-(sp)             ; First  argument is function
  50.         rts
  51.  
  52. *   Could have added any other functions needed for other call-backs.
  53. *   Could have written a fancier single one... Could've...
  54.